package com.xhq.wms.service.system.impl;

import com.xhq.commons.dto.Pageable;
import com.xhq.commons.util.StringUtils;
import com.xhq.wms.dao.system.PlanDao;
import com.xhq.wms.entity.system.Plan;
import com.xhq.wms.service.system.PlanService;

public class PlanServiceImpl implements PlanService{
    PlanDao planDao =new PlanDao();
    @Override
    public Pageable<Plan> list(Integer offset,Integer limit) {
        Pageable<Plan> page = planDao.findPage(offset, limit);
        return page;
    }

    @Override
    public void save(Plan plan) {
       planDao.save(plan);
    }

    @Override
    public void delete(Integer id) {
        planDao.delete(id);
    }

    @Override
    public void deleteBatch(String ids) {
        if(StringUtils.notEmpty(ids)){
            String [] idArr =ids.split(",");
            for(String id:idArr){
                this.delete(Integer.valueOf(id));
            }
        }
    }

    @Override
    public Plan find(Integer id) {
        Plan plan = planDao.find(id);
        return plan;
    }
}
